package LeetCode.NumOffer;

/**
 * 数组中只出现一次的元素
 * @author lumin
 * @date 2022/03/22 17:44
 **/
public class NumOffer56 {
    public int singleNumber(int[] nums) {
        int ret = nums[0];
        for (int i = 1; i < nums.length; i++) {
            ret = ret ^ nums[i];
        }
        return ret;
    }
}